package com.ruoyi.common.constant;

/**
 * 常用字符串常量类
 * 包含常用分隔符、特殊符号和业务字符串定义
 */
public final class StringConstants {

    // 防止类被实例化
    private StringConstants() {}

    /**************************
     *  常用分隔符和符号
     **************************/

    /** 冒号分隔符 ":" */
    public static final String COLON = ":";
    /** 三重百分比符号 "%%%" */
    public static final String TRIPLE_PERCENT = "%%%";

    /** 逗号 "," */
    public static final String COMMA = ",";
    /** 句号 "." */
    public static final String DOT = ".";
    /** 分号 ";" */
    public static final String SEMICOLON = ";";
    /** 连字符 "-" */
    public static final String HYPHEN = "-";
    /** 下划线 "_" */
    public static final String UNDERSCORE = "_";
    /** 等号 "=" */
    public static final String EQUALS = "=";
    /** 加号 "+" */
    public static final String PLUS = "+";
    /** 斜杠 "/" */
    public static final String SLASH = "/";
    /** 反斜杠 "\" */
    public static final String BACKSLASH = "\\";
    /** 空格 " " */
    public static final String SPACE = " ";

    /** 星号 "*" */
    public static final String ASTERISK = "*";
    /** 美元符号 "$" */
    public static final char DOLLAR = '$';
    /** 井号 "#" */
    public static final String HASH = "#";
    /** 百分号 "%" */
    public static final String PERCENT = "%";
    /** 问号 "?" */
    public static final String QUESTION_MARK = "?";

    /**************************
     *  常用业务字符串常量
     **************************/

    /** 报警状态 */
    public static final String ALARM = "报警";
    /** 正常状态 */
    public static final String NORMAL = "正常";
    /** 警告状态 */
    public static final String WARNING = "警告";
    /** 故障状态 */
    public static final String FAULT = "故障";
    /** 离线状态 */
    public static final String OFFLINE = "离线";
    /** 回车换行符 "<CR><LF>" */
    public static final String CRLF = "<CR><LF>";
    /** 回车符 "<CR>" */
    public static final String CR = "<CR>";
    /** 换行符 "<LF>" */
    public static final String LF = "<LF>";
    /** 制表符 "<TAB>" */
    public static final String TAB = "<TAB>";

    /**************************
     *  常用业务字符串常量
     **************************/

    /** 通道 */
    public static final String CHANNEL = "通道";
    /** 设备 */
    public static final String DEVICE = "设备";
    /** 传感器 */
    public static final String SENSOR = "传感器";
    /** 控制器 */
    public static final String CONTROLLER = "控制器";
    /** 灯 */
    public static final String LIGHT = "灯";
    /** 值为 */
    public static final String VALUE_IS = "值为";
    /** 设备报警 */
    public static final String DEVICE_ALARM = " 设备报警";
    /** 系统故障 */
    public static final String SYSTEM_FAILURE = "系统故障";
    /** 网络断开 */
    public static final String NETWORK_DISCONNECTED = "网络断开";
    /** 数据异常 */
    public static final String DATA_ANOMALY = "数据异常";

    /**************************
     *  常用单位字符串常量
     **************************/

    /** 千克 "KG" */
    public static final String KILOGRAM = "KG";
    /** 克 "G" */
    public static final String GRAM = "G";
    /** 吨 "T" */
    public static final String TON = "T";
    /** 米 "M" */
    public static final String METER = "M";
    /** 厘米 "CM" */
    public static final String CENTIMETER = "CM";

    /**
     * 判断字符串是否为分隔符
     * @param str 待检查的字符串
     * @return true如果是预定义的分隔符，否则false
     */
    public static boolean isSeparator(String str) {
        return COLON.equals(str) || COMMA.equals(str) || DOT.equals(str) ||
                SEMICOLON.equals(str) || HYPHEN.equals(str) || UNDERSCORE.equals(str) ||
                EQUALS.equals(str) || PLUS.equals(str) || SLASH.equals(str) ||
                BACKSLASH.equals(str) || SPACE.equals(str) || TRIPLE_PERCENT.equals(str);
    }

    // 保持原有工具方法...
}
